package com.davidlife.javase.datatype;

import java.io.IOException;
import java.io.PrintWriter;
import java.nio.file.Paths;
import java.util.Scanner;

public class FileOutputInput {

	public static void main(String[] args) throws IOException {
		
		String dir = System.getProperty("user.dir");
		System.out.println(dir);
		
		Scanner in = new Scanner(Paths.get("D:\\Workspace\\MasterSpring\\knowledge-javaSE-demo\\src\\com\\davidlife\\javase\\datatype\\FileOutputInput.java"), "UTF-8");
		PrintWriter out = new PrintWriter("test\\output.txt", "UTF-8");
		
		while(in.hasNextLine()) {
			String line = in.nextLine();
			out.println(line);
		}
		out.flush();
		in.close();
		out.close();
	}

}
